package com.lyj.controller;

import com.lyj.pojo.Admin;
import com.lyj.pojo.Nurse;
import com.lyj.service.AdminService;
import com.lyj.service.NurseService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

@Controller
public class LoginController {

    @Autowired
    NurseService nurseService;
    @Autowired
    AdminService adminService;
    //登录
    @RequestMapping(value = "/adminLogin",method = RequestMethod.POST)
    @ResponseBody
    public Admin adminLogin(String username,
                       String password,
                      String duty,
                      HttpSession session) {


            Admin login = adminService.adminLogin(username, password, duty);
        return login;
    }

    @RequestMapping(value = "/nurseLogin",method = RequestMethod.POST)
    @ResponseBody
    public Nurse nurseLogin(String username,
                        String password,
                       String duty,
                       HttpSession session) {

        Nurse login = nurseService.login(username, password, duty);

        return login;

    }

}
